import React, { useEffect } from 'react';
import CityPickerModal from './CityPickerModal';

/**
 * 首页模态框组件
 * @param {Object} props 组件属性
 * @param {boolean} props.pickerVisible 城市选择器是否可见
 * @param {Array} props.cityList 城市列表
 * @param {Function} props.onPickerClose 城市选择器关闭回调
 * @param {Function} props.onCitySelect 城市选择回调
 * @returns {JSX.Element} 模态框组件
 */
export default function HomeModals({
  pickerVisible,
  cityList,
  onPickerClose,
  onCitySelect,
}) {

  return (
    <>
      {/* 城市选择器 */}
      <CityPickerModal
        visible={pickerVisible}
        onClose={onPickerClose}
        onSelect={onCitySelect}
        cities={cityList}
      />
    </>
  );
}
